function test(){
    let score=0;
    //填空题
    let d1= ['统一建模语言','封装性','继承性','多态性'] ;
    let collection_a1 = [] ;
 let arr1 = document.getElementById("blank").getElementsByTagName('input') ;
 console.log(arr1);
    for(let item of arr1){
   collection_a1.push(item.value);
 }
 console.log(collection_a1);
  for (var key in collection_a1) {
    if (collection_a1[key] !== d1[key]) {

       }else{
      score +=5 ;
    }
   }
//单选题
    let d2 = ['A','C'] ;
    let collection_a2= [] ;
   let arr2 = document.getElementById("choice").getElementsByTagName('input') ;
   for(let item of arr2){
     if(item.checked){
       collection_a2.push(item.value);
     }
   }
    for (var key in collection_a2) {
     if (collection_a2[key] !== d2[key]) {
        
     }else{
         score += 10 ;
     }
    }
//多选题
    let d3 = ['A','B','D'];
    let d4= ['A','B','C'] ;
    let collection_a3 = [];
    let collection_b3=[];
    let arr3 = document.getElementById("mulit1").getElementsByTagName('input');
    let brr3 = document.getElementById("mulit2").getElementsByTagName('input');
      for(let item of arr3){
         if(item.checked){
          collection_a3.push(item.value);
          
             }
        }
      for(let item of brr3){
         if(item.checked){
          collection_b3.push(item.value);
             }
          }
      for (var key in collection_a3) {
        if (collection_a3[key] !== d3[key]) {
               
         }else{
          score += 10/3 ;
         }
        }
      for (var key in collection_b3) {
        if (collection_b3[key] !== d4[key]) {
                
         }else{
       score += 10/3 ;
         }
        } 
//判断题
    let d5 = ['√','×'] ;
       let collection_a4 = [] ;
       let arr4 = document.getElementById("judge").getElementsByTagName('input') ;
   for(let item of arr4){
       if(item.checked){
          collection_a4.push(item.value);
              }
          }
      for (var key in collection_a4) {
      if (collection_a4[key] !== d5[key]) {

        }else{
         score += 10 ;
          }
         } 
//简答题
    let collection_a5 = [] ;
 let arr5 = document.getElementById("text").getElementsByTagName('textarea') ;
 console.log(arr5);
    for(let item of arr5){
   collection_a5.push(item.value);
 }
 console.log(collection_a5[0].length)
    if (collection_a5[0].length>0) {
     score +=20 ;
    }
    let a=document.getElementById("姓名");
    let final=a.value;
    alert(final+"同学，你的分数为："+Math.round(score));
}

// let result= document.getElementById('final');
//     result.innerHTML = parseInt(score);


  

 
 





























//     btn.addEventListener("click",function(e){
//     let brr2= document.getElementsByName("options").checked;
//     let answer= brr2.value;
//     alert(answer);
//     score.innerHTML=""
//     })
// }
// for (var i = 1; i <= 5; i++) {//获取radio的值
//     var radio_name = new String("radio_" + i);
//     radio[i - 1] = $('input:radio[name=' + radio_name + ']:checked').val()
//     }
//     for (var i = 1; i <= 2; i++) {//获取checkbox的的输入
//     var checkbox_name = new String("checkbox_" + i);
//     var chk_value = [];
//     $('input:checkbox[name=' + checkbox_name + ']:checked').each(function () {
//     chk_value.push($(this).val());
//     });
//     radio[i + 4] = "";//置为空
//     for (var j = 0; j < chk_value.length; j++) {
//     radio[i + 4] = radio[i + 4] + chk_value[j];
//     }
// }



